#ifndef __MCELLIPSEVISUAL_H_
#define __MCELLIPSEVISUAL_H_

#include <MCGraphicsItem.h>
#include <MCEllipse2D.h>

class MCEllipseVisual : public MCGraphicsItem
{
public:

    MCEllipseVisual(ICanvas *presenter, const MCEllipse2D &ellipse);

    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
    bool contains(const QPointF &point) const override;
    QPainterPath shape() const override;

    void setGripAt(IGripPoint *grip, const MCPoint2D &pos) override;
    void resetGrips() override;

    MCEllipse2D ellipse() const;
    void update(const MCPoint2D &center, double rx, double ry);
    void update(const MCEllipse2D &ellipse);

protected:

    MCEllipse2D transformed() const;
    void initGripPoints();

private:

    MCEllipse2D _ellipseModel;

};

#endif // !__MCELLIPSEVISUAL_H_
